package com.bbg.amyam.domain.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord(finders = { "findEmployeesByProfile", "findEmployeesBySchool" })
public class Employee extends Person {

    @NotNull
    @ManyToOne(fetch = FetchType.LAZY)
    private School school;

    @NotNull
    private Boolean activeStatus;

    @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private Set<SchoolRole> schoolRoles = new HashSet<SchoolRole>();
}
